package org.blueoxygen.kukuruyuk.actions.supplier;
import java.util.ArrayList;
import java.util.List;
import org.blueoxygen.cimande.persistence.PersistenceAware;
import org.blueoxygen.cimande.persistence.PersistenceManager;
import org.blueoxygen.kukuruyuk.entity.Supplier;
import org.blueoxygen.kukuruyuk.actions.supplier.ListSupplier;

import com.opensymphony.xwork2.ActionSupport;
public class ListSupplier extends ActionSupport 
implements PersistenceAware {
	private PersistenceManager manager;
	private List<ListSupplier> suppliers = new ArrayList<ListSupplier>();
	
	@Override
	public String execute() throws Exception {
		setSuppliers(manager.getList("SELECT p FROM " + Supplier.class.getName()
				+ " p WHERE p.logInformation.activeFlag=1", null, null));
		return SUCCESS;
	}
	@Override
	public void setPersistenceManager(PersistenceManager arg0) {
		this.manager = arg0;

	}
	public PersistenceManager getManager() {
		return manager;
	}
	public void setManager(PersistenceManager manager) {
		this.manager = manager;
	}
	public List<ListSupplier> getSuppliers() {
		return suppliers;
	}
	public void setSuppliers(List<ListSupplier> suppliers) {
		this.suppliers = suppliers;
	}
	
}
